package br.xraylol.test.client;

import static org.junit.Assert.assertNotNull;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import br.xraylol.bean.riot.MasteryPageBean;
import br.xraylol.bean.riot.SummonerBean;
import br.xraylol.client.SummonerClient;
import br.xraylol.custom.list.RunePageList;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring-module.xml")
public class SummonerTestClient {
	
	@Autowired
	SummonerClient client;
	
	@Test
	public void findSummonersByName() {
		HashMap<String, SummonerBean> summoners = client.findSummonersByName(getNames());
		
		assertNotNull(summoners);
	}
	
	@Test
	public void findSummonersById() {
		HashMap<String, SummonerBean> summoners = client.findSummonersById(getIds());
		
		assertNotNull(summoners);
	}
	
	@Test
	public void findSummonersMasteries() {
		HashMap<String, MasteryPageBean> summonersMasteries = client.findSummonersMasteries(getIds());
		
		assertNotNull(summonersMasteries);
	}
	
	@Test
	public void findSummonersName() {
		HashMap<String, String> summonersName = client.findSummonersName(getIds());
		
		assertNotNull(summonersName);
	}
	
	@Test
	public void findSummonersRunes() {
		HashMap<String, RunePageList> summonersRunes = client.findSummonersRunes(getIds());
		
		assertNotNull(summonersRunes);
	}

	private List<String> getNames() {
		List<String> names = new ArrayList<String>();
		names.add("VitorTadashi");
		names.add("Difosal2");
		
		return names;
	}
	
	private List<Long> getIds() {
		List<Long> ids = new ArrayList<Long>();
		ids.add(2000861L);
		ids.add(5541310L);
		
		return ids;
	}
}
